let mongoose = require("./db");

let UserSchema = new mongoose.Schema({
    name: String,//称号
    password: String,//密码
    base: String, //人脸
    avatar: String,//头像
    fullname: String,//真实姓名
    state: String,//性别
    captcha: String,//手机验证码
    phone: String,//手机号
    email: String,//邮箱
    position: String,//职务
    qrcode: String,//二维码信息
    openid: String,//用户身份id
    provider: String,// 第三方登入
    friends: {
        type: Array,
        default: []
    }//好友列表，存ID
})
let UserModel = mongoose.model('User', UserSchema, 'User')

UserModel.create({
    name:"admin",
    password:"112233",
    base:"",
    avatar:"",
    fullname:"",
    state:"",
    captcha:"",
    phone:"",
    email:"",
    position:"",
    qrcode:"",
    openid:"",
    provider:"",
    friends:[]
})
module.exports = { UserModel }
